import type { MockMethod } from 'vite-plugin-mock';
import config from '../../_config';

export default [
	// licence
	{
		url: '/dict/getDictDetailByCode',
		method: 'get',
		timeout: config.timeout,
		response: ({ query, body }) => {
			let data: any[] = [];
			switch (query.dictTypeCode) {
				case 'device_type':
					data = [
						{
							id: 282,
							dictTypeId: 13,
							dictName: '组串式逆变器',
							dictEnName: 'String inverter',
							dictData: 1,
							idx: 1,
							status: true,
						},
						{
							id: 272,
							dictTypeId: 13,
							dictName: '数采',
							dictEnName: 'SAU',
							dictData: 2,
							idx: 2,
							status: true,
						},
						{
							id: 273,
							dictTypeId: 13,
							dictName: '环境监测仪',
							dictEnName: 'Yanaco',
							dictData: 10,
							idx: 3,
							status: true,
						},
						{
							id: 275,
							dictTypeId: 13,
							dictName: '通管机',
							dictEnName: 'DPU',
							dictData: 13,
							idx: 5,
							status: true,
						},
						{
							id: 276,
							dictTypeId: 13,
							dictName: '集中式逆变器',
							dictEnName: 'Centralized inverter',
							dictData: 14,
							idx: 6,
							status: true,
						},
						{
							id: 277,
							dictTypeId: 13,
							dictName: '直流汇流箱',
							dictEnName: 'DC combiner box',
							dictData: 15,
							idx: 7,
							status: true,
						},
						{
							id: 278,
							dictTypeId: 13,
							dictName: '关口电表',
							dictEnName: 'Gateway meter',
							dictData: 17,
							idx: 8,
							status: true,
						},
						{
							id: 279,
							dictTypeId: 13,
							dictName: '汇集站线路电表',
							dictEnName: 'Collector wire meter',
							dictData: 18,
							idx: 9,
							status: true,
						},
						{
							id: 280,
							dictTypeId: 13,
							dictName: '中压单元',
							dictEnName: 'Medium voltage unit',
							dictData: 48,
							idx: 10,
							status: true,
						},
						{
							id: 281,
							dictTypeId: 13,
							dictName: '通用设备',
							dictEnName: 'General device',
							dictData: 201,
							idx: 11,
							status: true,
						},
					];
					break;
				default:
					break;
			}
			return {
				code: config.resultCode,
				message: 'success',
				results: data,
			};
		},
	},
	{
		url: '/dict/getDictPage',
		method: 'get',
		timeout: config.timeout,
		response: ({ query, body }) => {
			return {
				code: config.resultCode,
				message: 'success',
				results: {
					records: [
						{
							id: 20,
							dictTypeCode: 'track_run_status_in',
							dictTypeName: '支架运行模式 (内)',
							detailValueType: 1,
							remark: '智能跟踪页面的弹窗中的支架运行模式，需要鉴权',
						},
						{
							id: 19,
							dictTypeCode: 'track_run_status_out',
							dictTypeName: '支架运行模式 (外)',
							detailValueType: 1,
							remark: '智能跟踪页面的外部支架运行模式，不需要鉴权',
						},
						{
							id: 18,
							dictTypeCode: 'alarm_type',
							dictTypeName: '告警类型',
							detailValueType: 1,
							remark: '告警类型',
						},
						{
							id: 17,
							dictTypeCode: 'alarm_level',
							dictTypeName: '告警级别',
							detailValueType: 1,
							remark: '告警级别',
						},
						{
							id: 16,
							dictTypeCode: 'signal_type',
							dictTypeName: '信号点类型',
							detailValueType: 1,
							remark: '信号点类型',
						},
						{
							id: 13,
							dictTypeCode: 'device_type',
							dictTypeName: '设备类型',
							detailValueType: 1,
							remark: '系统能接入的设备类型',
						},
					],
					total: 6,
					size: 20,
					current: 1,
					orders: [],
					optimizeCountSql: true,
					searchCount: true,
					maxLimit: null,
					countId: null,
					pages: 1,
				},
			};
		},
	},
	{
		url: '/dict/getDictDetail',
		method: 'get',
		timeout: config.timeout,
		response: ({ query, body }) => {
			return {
				code: config.resultCode,
				message: 'success',
				results: [
					{
						id: 154,
						dictTypeId: 13,
						dictName: '组串式逆变器',
						dictEnName: 'String Inverter',
						dictData: '1',
						idx: 1,
						status: true,
					},
					{
						id: 155,
						dictTypeId: 13,
						dictName: '数采',
						dictEnName: 'Data Collector',
						dictData: '2',
						idx: 2,
						status: true,
					},
					{
						id: 156,
						dictTypeId: 13,
						dictName: '环境监测仪',
						dictEnName: 'Environmental Monitor',
						dictData: '10',
						idx: 3,
						status: true,
					},
					{
						id: 157,
						dictTypeId: 13,
						dictName: '交流汇流箱',
						dictEnName: '',
						dictData: '11',
						idx: 4,
						status: false,
					},
					{
						id: 158,
						dictTypeId: 13,
						dictName: '通管机',
						dictEnName: 'DPU',
						dictData: '13',
						idx: 5,
						status: true,
					},
					{
						id: 159,
						dictTypeId: 13,
						dictName: '集中式逆变器',
						dictEnName: 'Central Inverter',
						dictData: '14',
						idx: 6,
						status: true,
					},
					{
						id: 160,
						dictTypeId: 13,
						dictName: '直流汇流箱',
						dictEnName: 'DC Combiner Box',
						dictData: '15',
						idx: 7,
						status: true,
					},
					{
						id: 161,
						dictTypeId: 13,
						dictName: '关口电表',
						dictEnName: 'Gateway Meter',
						dictData: '17',
						idx: 8,
						status: true,
					},
					{
						id: 162,
						dictTypeId: 13,
						dictName: '汇集站线路电表',
						dictEnName: 'Box Change Meter',
						dictData: '18',
						idx: 9,
						status: true,
					},
					{
						id: 163,
						dictTypeId: 13,
						dictName: '中压单元',
						dictEnName: 'Transformer',
						dictData: '48',
						idx: 10,
						status: true,
					},
					{
						id: 164,
						dictTypeId: 13,
						dictName: '通用设备',
						dictEnName: 'General Device',
						dictData: '201',
						idx: 11,
						status: true,
					},
					{
						id: 272,
						dictTypeId: 13,
						dictName: '支架采集器',
						dictEnName: 'SUPPORT Data Collector',
						dictData: '49',
						idx: 12,
						status: true,
					},
					{
						id: 273,
						dictTypeId: 13,
						dictName: '支架控制器',
						dictEnName: 'SUPPORT Controller',
						dictData: '50',
						idx: 13,
						status: true,
					},
					{
						id: 283,
						dictTypeId: 13,
						dictName: 'AGC/AVC-MODBUS',
						dictEnName: 'AGC/AVC-MODBUS',
						dictData: '202',
						idx: 14,
						status: true,
					},
					{
						id: 284,
						dictTypeId: 13,
						dictName: 'NCU',
						dictEnName: 'NCU',
						dictData: '51',
						idx: 14,
						status: true,
					},
					{
						id: 285,
						dictTypeId: 13,
						dictName: 'TCU',
						dictEnName: 'TCU',
						dictData: '52',
						idx: 15,
						status: true,
					},
					{
						id: 286,
						dictTypeId: 13,
						dictName: '摄像头网关',
						dictEnName: 'Camera gateway',
						dictData: '53',
						idx: 16,
						status: true,
					},
				],
			};
		},
	},
] as MockMethod[];
